<template>
	<view>
		<list-header>
			<text slot="title">猜你喜欢</text>
			<template #tips> 更多推荐 </template>
		</list-header>
		<view class="flex align-center">
			<block v-for="(item, index) in Rebooks" :key="index">
				<view class="position-relative flex flex-column align-center flex-1 w-100" style="height: 300rpx;"
					@tap="toBookDetail(index)">
					<image :src="item.src" mode="widthFix" class="w-100"></image>
					<text class="my-1 font text-light-black">{{item.name}}</text>
					<iconfont class="position-absolute" style="left: 45rpx; top: 20rpx;" iconId="icon-erji"
						iconColor="text-light" iconSize="35"></iconfont>
				</view>
			</block>
		</view>
	</view>
</template>

<script>
	import listHeader from "@/components/listHeader.vue"

	export default {
		name: "recomend",
		props: {
			Rebooks: {
				type: Array,
				default: () => []
			}
		},
		data() {
			return {

			};
		},
		components: {
			listHeader
		},
		methods: {
			toBookDetail(index) {
				if (index === 0) {
					uni.navigateTo({
						url: '/pages/bookDetail/bookDetail?bookID=2001'
					})
				}
			}
		}
	}
</script>

<style>

</style>
